<?php

namespace Proj\ResManBundle\Entity;

use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints as Assert;
use Doctrine\ORM\Mapping as ORM;

use Proj\ResManBundle\Entity\Level;
/**
 * AcademicProgram
 *
 * @ORM\Table(name="academic_program")
 * @ORM\Entity
 */
class AcademicProgram
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var integer
     *
     * @ORM\Column(name="level", type="integer")
     */
    private $level;

    /**
     * @var integer
     *
     * @ORM\Column(name="duration", type="integer")
     */
    private $duration;

    /**
     * @var string
     *
     * @ORM\Column(name="profile", type="string", length=255)
     */
    private $profile;

    /**
     * @var string
     *
     * @ORM\Column(name="type", type="string", length=255)
     */
    private $type;

     /**
     * @var string
     *
     * @ORM\Column(name="language", type="string", length=255)
     */
    private $language;


    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set level
     *
     * @param Level $level
     * @return AcademicProgram
     */
    public function setLevel($level)
    {
        $this->level = $level;

        return $this;
    }

    /**
     * Get level
     *
     * @return Level 
     */
    public function getLevel()
    {
        return $this->level;
    }

    /**
     * Set duration
     *
     * @param integer $duration
     * @return AcademicProgram
     */
    public function setDuration($duration)
    {
        $this->duration = $duration;

        return $this;
    }

    /**
     * Get duration
     *
     * @return integer 
     */
    public function getDuration()
    {
        return $this->duration;
    }

    /**
     * Set profile
     *
     * @param string $profile
     * @return AcademicProgram
     */
    public function setProfile($profile)
    {
        $this->profile = $profile;

        return $this;
    }

    /**
     * Get profile
     *
     * @return string 
     */
    public function getProfile()
    {
        return $this->profile;
    }

    /**
     * Set type
     *
     * @param string $type
     * @return AcademicProgram
     */
    public function setType($type)
    {
        $this->type = $type;

        return $this;
    }

    /**
     * Get type
     *
     * @return string 
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Set language
     *
     * @param string $language
     * @return AcademicProgram
     */
    public function setLanguage($language)
    {
        $this->language = $language;

        return $this;
    }

    /**
     * Get language
     *
     * @return string 
     */
    public function getLanguage()
    {
        return $this->language;
    }

     public static function loadValidatorMetadata(ClassMetadata $metadata)
    {
        
        $metadata->addPropertyConstraint('profile', new NotBlank(array(
            'message' => 'Trebuie sa introduceti specializarea.'
        )));
        $metadata->addPropertyConstraint('duration', new NotBlank(array(
            'message' => 'Trebuie sa introduceti durata de studiu.'
        )));
        $metadata->addPropertyConstraint('duration', new Assert\Range(array(
            'min'        => 1,
            'minMessage' => 'Durata de studiu trebuie sa fie mai mare decat 1.'
        )));
       
        $metadata->addPropertyConstraint('type', new NotBlank(array(
            'message' => 'Trebuie sa introduceti tipul programului.'
        )));
        $metadata->addPropertyConstraint('level', new NotBlank(array(
            'message' => 'Trebuie sa introduceti nivelul.'
        )));
        
        $metadata->addPropertyConstraint('language', new NotBlank(array(
            'message' => 'Trebuie sa introduceti limbile de predare.'
        )));
        
    }

}
